package com.example.xitong;

import androidx.appcompat.app.AppCompatActivity;
import androidx.constraintlayout.widget.ConstraintLayout;

import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.MediaController;
import android.widget.VideoView;

import com.gyf.immersionbar.ImmersionBar;

public class Videoplay extends AppCompatActivity{
    VideoView v1;
    ConstraintLayout c1;
    ConstraintLayout c2;
    ConstraintLayout c3;
    ConstraintLayout c4;
    ConstraintLayout c5;
    ConstraintLayout c6;
    ConstraintLayout c7;
    ConstraintLayout c8;
    ConstraintLayout c9;
    MediaController mediaController;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_videoplay);

        ImmersionBar.with(this)
                .statusBarColor(R.color.touming)
                .init();

        c1=findViewById(R.id.con01);
        c2=findViewById(R.id.con02);
        c3=findViewById(R.id.con03);
        c4=findViewById(R.id.con04);
        c5=findViewById(R.id.con05);
        c6=findViewById(R.id.con06);
        c7=findViewById(R.id.con07);
        c8=findViewById(R.id.con08);
        c9=findViewById(R.id.con09);

        v1=findViewById(R.id.videoView);
        mediaController=new MediaController(this);
        mediaController.setAnchorView(v1);






        c1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Uri uri=Uri.parse("https://stream7.iqilu.com/10339/upload_transcode/202002/18/20200218114723HDu3hhxqIT.mp4");
                v1.setMediaController(mediaController);
                v1.setVideoURI(uri);
                v1.start();
            }
        });
        c2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Uri uri=Uri.parse("https://stream7.iqilu.com/10339/upload_transcode/202002/18/20200218093206z8V1JuPlpe.mp4");
                v1.setMediaController(mediaController);
                v1.setVideoURI(uri);
                v1.start();
            }
        });
       c3.setOnClickListener(new View.OnClickListener() {
           @Override
           public void onClick(View view) {
               Uri uri=Uri.parse("https://stream7.iqilu.com/10339/upload_transcode/202002/09/20200209104902N3v5Vpxuvb.mp4");
               v1.setMediaController(mediaController);
               v1.setVideoURI(uri);
               v1.start();
           }
       });
        c4.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Uri uri=Uri.parse("https://stream7.iqilu.com/10339/upload_transcode/202002/18/20200218025702PSiVKDB5ap.mp4");
                v1.setMediaController(mediaController);
                v1.setVideoURI(uri);
                v1.start();
            }
        });
        c5.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Uri uri=Uri.parse("https://stream7.iqilu.com/10339/upload_transcode/202002/18/202002181038474liyNnnSzz.mp4");
                v1.setMediaController(mediaController);
                v1.setVideoURI(uri);
                v1.start();
            }
        });
        c6.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Uri uri=Uri.parse("https://stream7.iqilu.com/10339/upload_transcode/202002/09/20200209105011F0zPoYzHry.mp4");
                v1.setMediaController(mediaController);
                v1.setVideoURI(uri);
                v1.start();
            }
        });
        c7.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Uri uri=Uri.parse("https://stream7.iqilu.com/10339/upload_transcode/202002/17/20200217101826WjyFCbUXQ2.mp4");
                v1.setMediaController(mediaController);
                v1.setVideoURI(uri);
                v1.start();
            }
        });
        c8.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Uri uri=Uri.parse("http://www.infinityandroid.com/videos/video5.mp4");
                v1.setMediaController(mediaController);
                v1.setVideoURI(uri);
                v1.start();
            }
        });
        c9.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Uri uri=Uri.parse("https://stream7.iqilu.com/10339/upload_transcode/202002/18/20200218025702PSiVKDB5ap.mp4");
                v1.setMediaController(mediaController);
                v1.setVideoURI(uri);
                v1.start();
            }
        });

    }

}